<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="e" uri="/easytogo-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title></title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<e:base/>
	<script type="text/javascript">
        setBodyOnLoad(doEventHandler);
        var t;
        function doEventHandler(){
	        t = uiManager.getObject("leftTree");
            var ids = "${resourceIds}";
            var idArray = ids.split(",");
            setTimeout(function(){//树加载完成之后再选中,需要延时一下,(应该是个bug)
	            for(var i=0;i<idArray.length;i++){
	            	var id = idArray[i];
	            	t.setCheck(id, true);
	            }
            },200);
        }
        function onSure(){
        	var checkedIds = t.getAllChecked();
        	window.returnValue=checkedIds;
			window.close();
        }
    </script>
  </head>
  
  <body>
	  <div style="height: 100%;width: 30%;float: left;">
		  <e:tree id="leftTree" treeLoadUrl="${pageContext.request.contextPath }/common/tree_getTreeData.action?admin=${admin}" height="100%" isEnableCheckBoxes="true" isEnableThreeStateCheckboxes="false"/>
	  </div>
	  <button onclick="onSure();">确定</button>
  </body>
</html>
